<template>
  <div>
    <myheader/>
    <van-field
      v-model="form.name"
      name="name"
      label="名称"
      placeholder="名称"
      :rules="[{ required: true, message: '请填写名称' }]"
    />
    <van-field
      v-model="form.level"
      name="level"
      label="等级"
      placeholder="等级"
      :rules="[{ required: true, message: '请填写等级' }]"
    />
    <van-field
      v-model="form.params"
      name="params"
      label="参数配置"
      placeholder="参数配置"
      :rules="[{ required: true, message: '请填写参数配置' }]"
    />
    <van-button style="width: 230px" round type="info" color="linear-gradient(to right, #ff6034, #ee0a24)" @click="add">提交</van-button>
  </div>
</template>

<script>
import myheader from "../myheader";

export default {
  name: "cate",
  data() {
    return {
      form:{parent:0}
    }
  },
  methods:{
    add(){
      this.$axios.post('course/cateM',this.form).then(res=>{
        if(res.data.code==200){
          alert('添加成功')
          this.form={}
        }
      })
    }
  },
  mounted() {

  },
  components:{
    'myheader':myheader
  }
}
</script>

<style scoped>

</style>
